package com.yiqi.liebang.feature.mine.view;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.widget.TextView;

import com.suozhang.framework.framework.BaseActivity;
import com.yiqi.liebang.R;
import com.yiqi.liebang.entity.bo.UserCardBo;
import com.yiqi.liebang.entity.bo.UserCenterBo;
import com.yiqi.liebang.entity.bo.UserDataBo;
import com.yiqi.liebang.entity.enums.Certificate;
import com.yiqi.liebang.feature.mine.contract.CertificationContract;
import com.yiqi.liebang.feature.mine.contract.UserContract;
import com.yiqi.liebang.feature.mine.dependencies.login.DaggerUserComponent;
import com.yiqi.liebang.feature.mine.dependencies.login.UserPresenterModule;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class CertificationSuccessActivity extends BaseActivity implements UserContract.View {

    @BindView(R.id.toolbar)
    Toolbar mToolbar;

    @BindView(R.id.tv_succss_tips)
    TextView mTvSuccssTips;

    private int mType;

    private UserDataBo mData;

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_certification_success;
    }

    @Inject
    UserContract.Presenter mPresenter;


    @Override
    protected void initInjector() {
        DaggerUserComponent.builder().userPresenterModule(new UserPresenterModule(this)).build().inject(this);
    }

    @Override
    protected void initView() {
        initToolBar(mToolbar, "审核通过", true, true);
    }

    @Override
    protected void initData() {
        mType = this.getIntent().getIntExtra("type", 0);
        mTvSuccssTips.setText("恭喜！您已通过" + Certificate.getName(mType));
        mPresenter.getMineData();
    }


    @OnClick(R.id.btn_user_login)
    public void onViewClicked() {
        if (mData==null) return;
        if (mData.getIsBasic() == 1 || mData.getIsOccupation() == 1 || mData.getIsEducation() == 1 || mData.getMechanism() == 1) {
            Intent intent = new Intent(this, AddTopicActivity.class);
            intent.putExtra("is_add", true);
            startActivity(intent);
        }
    }


    @Override
    public void showUserCenterSuccess(UserCenterBo s) {

    }

    @Override
    public void showUserCenterError(String error) {

    }

    @Override
    public void showUserCardSuccess(UserCardBo s) {

    }

    @Override
    public void showMineSuccess(UserDataBo s) {
        mData = s;
    }

    @Override
    public void showLikeSuccess() {

    }

    @Override
    public void showPrivateSuccess(Boolean error) {

    }

    @Override
    public void showUserEditSuccess() {

    }

    @Override
    public void showDeleteFriendSuccess() {

    }

    @Override
    public void showAddBlackSuccess() {

    }

    @Override
    public void showError(String error) {

    }

}
